<template>
	<view class="goods-list">
		<view class="goods-double double flex flex-wrap row-between col-stretch p-l-20 p-r-20">
				<view class="item bg-white" :style="{width: '347rpx', height: '100%'}" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
					<view class="goods-img">
						<u-image width="347rpx" height="347rpx" :border-radius="10" :src="item.image"></u-image>
					</view>
					<view class="goods-info" style="padding: 22rpx 20rpx;">
						<view class="" style="padding: 10rpx 0">{{item.name}}</view>
						<view class="price mt10 row">
							<text class="primary">积分:{{item.need_integral}}</text>
	                    	<text v-if="item.exchange_way==2">+</text>
	                        <price-format v-if="item.exchange_way==2" :first-size="46" :second-size="32" :subscript-size="32"
	                            :price="item.need_money" :weight="500" />
						</view>
					</view>
				</view>
		</view>
		
	</view>
</template>

<script>
	import {
		integralGoodsTypeList
	} from "@/api/store"
	export default {
		props: {
			
		},
		data() {
			return {
				list:[]
			};
		},
		onLoad(options){

			this.getIntegralGoodsTypeList(options.typeId)
		},
		methods: {
			toDetail(item){
				uni.navigateTo({
					url:'/bundle/pages/integralMallDetail?obj='+JSON.stringify(item)
				})
			},
			getIntegralGoodsTypeList(id){
				integralGoodsTypeList({
					type:id
				}).then(res => {
					if (res.code == 1) {
						this.list=res.data.goods
					}
				}).catch(() => {
					this.mescroll.endErr();
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.goods-list {
		padding-bottom: 80rpx;
			.item {
				width: 347rpx;
				border-radius: 10rpx;
				overflow: hidden;
				margin-bottom: 30rpx;
				.goods-info {
					padding: 10rpx;
					
				}
			}
		.goods-double {
			.item {
				width: 347rpx;
				border-radius: 10rpx;
				overflow: hidden;
			
				.goods-info {
					padding: 10rpx;
					.goods-name {
						height: 80rpx;
						line-height: 40rpx;
					}

				}
			}
		}

	}
	.goods-img{
		border-bottom: solid 1rpx rgba(0,0,0,0.1);
	}
</style>